package com.cszjzx.member.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class LogoutAction extends ActionSupport{
	public String execute(){
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpSession session = request.getSession(false);//防止创建Session 
		if(session != null){
			if(session.getAttribute("student")!=null){
				session.removeAttribute("student");
			}
			else if(session.getAttribute("master")!=null){
				session.removeAttribute("master");
			}
        } 
		return SUCCESS;
	}
}
